#include "CommonDef.hlsli"

cbuffer cbFixed
{
    float3 gAccel;
    float g_StartLifetime;
};



VertexOut main(Particle particle)
{
    VertexOut vertexOut;
    float t = g_StartLifetime - particle.currentLifetime;
    vertexOut.finalPos = particle.initialPos.xyz +
        particle.initialVel.xyz * t
        + 0.5f * gAccel * t * t;
    vertexOut.size = particle.size;
    vertexOut.type = particle.type;
    float alpha = smoothstep(0.0f, 1.0f, 1.0f - particle.currentLifetime / PARTICLE_GEN_INTERVAL);
    vertexOut.color = float4(1.0f, 1.0f, 1.0f, alpha);
    return vertexOut;
}